__author__ = 'chenglin'
# -*- coding: utf-8 -*-
import uuid

from flask import Module, flash, request, g, current_app, \
    abort, redirect, url_for, session, jsonify

from flask_babel import gettext as _
from flask_principal import identity_changed, Identity, AnonymousIdentity
from app.models.users import User
from app.forms import  LoginForm
from  flask import render_template
from app.extensions import db


login = Module(__name__)

# @login.route("/login/", methods=("GET", "POST"))
# def login():
#     return render_template('login/main.html',
#                            title=u'IM管理平台登录')

# @login.route("/logout/")
# def logout():
#     flash(_("You are now logged out"), "success")
#     identity_changed.send(current_app._get_current_object(),
#                           identity=AnonymousIdentity())
#     return redirect(url_for('index'))


@login.route('/login',methods=['POST','GET'])
def mLogin():
    return '{"res":"","flag":"1","data":null,"msg":"操作成功"}'


@login.route('/main',methods=['POST','GET'])
def main():
    return render_template('login/main.html',title=u'IM管理平台')
